﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace UbwApplication
{
    public partial class ucDigitalInput : UserControl
    {
        public ucDigitalInput()
        {
            InitializeComponent();

            HighText = "ON";
            HighColor = Color.Green;
            LowText = "OFF";
            LowColor = DefaultBackColor;
            Value = false;
        }

        protected bool _value;
        public bool Value
        {
            get
            {
                return _value;
            }
            set
            {
                _value = value;
                uxStateText.Text = value ? HighText : LowText;
                uxStateText.BackColor = value ? HighColor : LowColor;
            }
        }

        public string HighText
        {
            get;
            set;
        }

        public Color HighColor
        {
            get;
            set;
        }

        public string LowText
        {
            get;
            set;
        }

        public Color LowColor
        {
            get;
            set;
        }
    }
}
